package com.dks.exception;

import com.dks.result.ResultInfo;
import lombok.Getter;


public class BaseException extends Exception {

    //异常对应的错误信息
    @Getter
    private ResultInfo resultInfo;

    public BaseException(ResultInfo resultInfo){
        super(resultInfo.getMessage());
        this.resultInfo = resultInfo;
    }

    public BaseException(ResultInfo resultInfo, String message){
        super(message);
        resultInfo.setMessage(message);
        this.resultInfo = resultInfo;
    }

}
